<?php
 class ApiCenter_SalesApi_Model_Request extends Mage_Api2_Model_Request{
     /**
      * Retrieve one of CRUD operation dependent on HTTP method
      *
      * @return string
      * @throws Mage_Api2_Exception
      */
     public function getOperation()
     {
         if (!$this->isGet() && !$this->isPost() && !$this->isPut() && !$this->isDelete() && !$this->isHead()) {
             throw new Mage_Api2_Exception('Invalid request method', Mage_Api2_Model_Server::HTTP_BAD_REQUEST);
         }
         // Map HTTP methods to classic CRUD verbs
         $operationByMethod = array(
             'GET'    => Mage_Api2_Model_Resource::OPERATION_RETRIEVE,
             'POST'   => Mage_Api2_Model_Resource::OPERATION_CREATE,
             'PUT'    => Mage_Api2_Model_Resource::OPERATION_UPDATE,
             'DELETE' => Mage_Api2_Model_Resource::OPERATION_DELETE,
             'HEAD' => "accept"
         );
     
         return $operationByMethod[$this->getMethod()];
     }
 }